package net.csdn.business.notify.api.controller;



import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.notify.common.model.dto.NewNotifyCallLogDTO;
import net.csdn.business.notify.common.model.dto.UpdateNotifyCallLogDTO;
import net.csdn.business.notify.common.model.query.NotifyCallLogQuery;
import net.csdn.business.notify.common.model.vo.NotifyCallLogVO;
import net.csdn.business.notify.api.service.INotifyCallLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 通知中心-接口调用记录Controller
 * 
 * @author ruoyi
 * @date 2023-11-27
 */
@RestController
@RequestMapping("/api/v1/notify/callLog")
public class NotifyCallLogController
{
    @Autowired
    private INotifyCallLogService notifyCallLogService;

    /**
     * 分页查询通知中心-接口调用记录列表
     */

    @GetMapping("/list")
    public Page<NotifyCallLogVO> findPageList(NotifyCallLogQuery query)
    {
        return notifyCallLogService.findPageList(query);
    }



    /**
     * 根据id获取通知中心-接口调用记录详细信息
     */
    @GetMapping(value = "/{id}")
    public NotifyCallLogVO getInfo(@PathVariable("id") String id)
    {
        return notifyCallLogService.selectNotifyCallLogById(id);
    }

    /**
     * 新增通知中心-接口调用记录
     */
    @PostMapping
    public Integer add(@RequestBody NewNotifyCallLogDTO notifyCallLog)
    {
        return notifyCallLogService.insertNotifyCallLog(notifyCallLog);
    }

    /**
     * 修改通知中心-接口调用记录
     */
    @PutMapping
    public Integer edit(@RequestBody UpdateNotifyCallLogDTO notifyCallLog)
    {
        return notifyCallLogService.updateNotifyCallLog(notifyCallLog);
    }

    /**
     * 删除通知中心-接口调用记录
     */
	@DeleteMapping("/{id}")
    public Integer remove(@PathVariable String id)
    {
        return notifyCallLogService.deleteNotifyCallLogById(id);
    }
}
